<% for user in @onlineUsers %>
<table class="friend" cellspacing="0" cellpadding="0" width="100%" border="0">
    <tr>
        <td class="friendImage">
            <a href="/home/index/<%=user.id %>">
                <% if user.userDetail.portrait!="" %>
                    <img src="/uploads/userPortrait/<%=user.userDetail.portrait%>" alt="<%=user.username%>" border="0" />
                <% else %>
                    <img src="/img/default_portrait_s.jpg" alt="<%=user.username %>" border="0" />
                <% end %>
            </a>
        </td>
        <td valign="top">
            <div class="friendContent">
                <div class="friendName">
                    <%=link_to user.username,:controller=>"home",:action=>"index",:id=>user.id%>
                </div>
                <div class="friendInfo">
                    <%=user.userDetail.sex%> 生日:<%=user.userDetail.birthday%> <%=user.userDetail.hometown%> Email:<%=user.email%></div>
                <div class="findFriendIntro">
                    <%=user.userDetail.intro %>
                </div>
            </div>
        </td>
        <td class="friendActionColumn">
            <ul class="friendActionList">
                <% if user==session[:user]%>
                <li><%=link_to "查看主页",:controller=>"home",:action=>"index",:id=>user.id%></li>
                <% elsif isFriend(user.id)%>
                <li><%= link_to "查看主页",:controller=>"home",:action=>"index",:id=>user.id%></li>
                <li><%= link_to "开始聊天",:controller=>"message",:action=>"chat",:id=>user.id,:friend_id=>session[:user].id %></li>
                <li><%= link_to "感情破裂了",:controller=>"friend",:action=>"delete",:friend_id=>user.id,:id=>session[:user].id %></li>
                <% else %>
                <li><%= link_to "查看主页",:controller=>"home",:action=>"index",:id=>user.id%></li>
                <li><%= link_to "开始聊天",:controller=>"message",:action=>"chat",:id=>user.id,:friend_id=>session[:user].id %></li>
                <li><%= link_to "加为好友",:controller=>"friend",:action=>"addFriend",:friend_id=>user.id,:id=>session[:user].id %></li>
                <% end %>
            </ul>
        </td>
    </tr>
</table>
<% end %>